<template>
    <el-table :data="tableData" style="width: 100%">
      <el-table-column label="Date" width="180">
      </el-table-column>
      <el-table-column label="Name" width="180">
      </el-table-column>
      <el-table-column label="Operations">
        <template #default="scope">
          <el-button size="small" @click="handleEdit(scope.$index, scope.row)"
            >编辑</el-button
          >
          <el-button
            size="small"
            type="danger"
            @click="handleDelete(scope.$index, scope.row)"
            >删除</el-button
          >
        </template>
      </el-table-column>
    </el-table>
  </template>
  
  <script setup>
  import *as permission from '@/api/permission'
  import { ref, onMounted } from 'vue'

  const handleEdit = (index, row) => {
    console.log(index, row)
  }
  const handleDelete = (index, row) => {
    console.log(index, row)
  }
  
  const tableData = ref([])

  let getPermissionConfig = async () =>{
    try {
        let res = await permission.getPermissionListApi()
        console.log(res);
        
    } catch (error) {
        console.log(error);
    }
  }
  onMounted(()=>{
    getPermissionConfig()
  })
  </script>
  